package cn.trip.biz.service;

import cn.itrip.beans.dto.Dto;
import cn.itrip.beans.pojo.ItripHotelOrder;
import cn.itrip.beans.pojo.ItripHotelRoom;
import cn.itrip.beans.pojo.ItripUseLinkUser;
import cn.itrip.beans.pojo.ItripUser;
import cn.itrip.beans.vo.ItripOrderInfoVO;
import cn.itrip.beans.vo.ItripOrderSelect;
import cn.itrip.beans.vo.ItripPersonalOrderRoomVO;
import cn.itrip.common.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.solr.client.solrj.SolrServerException;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

public interface ItripHotelOrderService {
    //根据id查询订单列表
    Dto<Page> selectByUserId(ItripOrderSelect itripOrderSelect) throws ParseException, SolrServerException;

    //根据id查询总记录数
    int selectCount(ItripOrderSelect itripOrderSelect);

    //根据id查询缓存中当前用户所有订单信息的那个符合的信息的详情
    Dto<ItripHotelOrder> selectDetailByidFromRedis(Long id, String redisOrderKey);

    //根据id查询订单
    ItripHotelOrder selectByPrimaryKey(Long id);

    //根据订单id删除订单
    Dto deleteByPrimaryKey(Long id);

    //从缓存中取token
    public ItripUser user(String token);

    //根据订单id查入住信息
    public ItripHotelRoom selectById(Long id);

    public Dto<ItripPersonalOrderRoomVO> getItripHotelOrderRoomInfoById(Long id);

    public Dto getOrderInfo(ItripOrderInfoVO itripOrderInfoVO, String token);

    public boolean updateStatusByScheduled(int status);

    //生成订单
    Dto addHotelOrder(Map<String, Object> HotelOrderMap, String token);

    Map<String, Object> itriptxAddItripHotelOrder(ItripHotelOrder itripHotelOrder, List<ItripUseLinkUser> linkUserList);

    boolean insertTempByScheduled() throws Exception;
}
